package com.vhly.util;

import java.io.InputStream;
import java.io.OutputStream;

/**
 * Created by IntelliJ IDEA.
 * User: vhly[FR]
 * Date: 2010-12-8
 * Time: 10:23:14
 */
public final class StreamUtil {
    private StreamUtil() {

    }

    public static void close(Object obj) {
        if (obj != null) {
            try {
                if (obj instanceof InputStream) {
                    ((InputStream) obj).close();
                } else if (obj instanceof OutputStream) {
                    ((OutputStream) obj).close();
                }
            } catch (Exception ex) {

            }
        }
    }
}
